<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="http://localhost/banggou/Template/default/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="http://localhost/banggou/Template/default/js/jquery.cookie.js" ></script>
<script type="text/javascript" src="http://localhost/banggou/Template/default/js/login.js" ></script>
<link  type="text/css" media="all" href="http://localhost/banggou/Template/default/css/reg.css"  rel="stylesheet" />
<!--
<script src="http://s.mb-go.com/pub7/style/js/jquery-1.4.2.min.js?vsion=20120619" type="text/javascript"></script>
<script type="text/javascript">
window.user_id = '';
statistics();
</script>
-->
<link rel="shortcut icon" href="http://localhost/banggou/Template/default/img/favicon.ico" type="image/x-icon">

</head>
<body>
<!--公用头部开始-->
<div id="banggoMoomoo">
<div class="Ctop Cwrap Lovh" >
	<img src="http://localhost/banggou/Template/default/img/2.jpg" alt="">
</div>
</div>
<input type="hidden" id="serviceValue" vaule="false"/>
<!--公用头部结束-->
<script type="text/javascript">
$(function(){
	var hasMvp = document.getElementById("serviceValue");
	if(hasMvp){
		$("#banggoMoomoo").addClass("topWrap");
	}
});
</script>
	<!-- <div class="head" style='margin-bottom:10px'>
		<img src="http://localhost/banggou/Template/default/img/2.jpg">
	</div> -->
	<!--注册页面开始-->
	<div class="Lovh Lpb30">
		<div class="RG_type Lmt10 Cwrap">
			<div class="Cwrap Lovh" id="changetab">
				<a id="normal" class="cstyle">普通注册</a> <a id="mobile">手机注册</a> <a
					id="card">MVP卡激活</a>

			</div>
		</div>
		<div class="RG_mbox Cwrap Lmt10 Lovh" id="form_div">
			<!--普通注册步骤一开始-->
			<div class="RG_sbox1 Lfll Lpt20 Lovh" id="normal_div">
				<div class="RG_title">
					第一步：填写账户信息（以下内容均为必填） <input type="hidden" id="submitType">
				</div>
				<form name="normal_form" id="normal_form" method="post"
					action="/CASServer/custom/registry.do"
					method="post">
					<input type="hidden" name="service" value="http://act.banggo.com/User/casregister.shtml">
					<input type="hidden" name="sourceCode" value="">
					<input type="hidden" name="little" value="9c7f52215d2865430edda96a77bf9ae4">
					<input type="hidden" id="vKey" name="vKey"
						value="WE4D" /> <input type="hidden"
						id="vValue" name="vValue" value="BU9B" />
					<div class="item Lovh Lmt15">
						<div class="ltext Lfll">用户名：</div>
						<div class="Lfll" style="width: 580px;">
							<div class="inputlbd Lfll">&nbsp;</div>
							<input id="username" name="uid" value=""
								class="input1 Lfll" /> <span class="tips">4-20个字符，一个汉字为两个字符，推荐使用中文会会员名字。一旦注册成功会员名将不能修改。</span>
							<span id="user_message" class="errorinfo Lcfl">&nbsp;</span>
						</div>
					</div>
					<div class="item Lovh">
						<div class="ltext Lfll">登录密码：</div>
						<div class="Lfll" style="width: 580px;">
							<div class="inputlbd Lfll">&nbsp;</div>
							<input id="password" name="pwd" class="input1 Lfll"
								value="" type="password" /> <span class="tips">6-16个字符，请使用字母加数字或符号的组合密码。</span>
							<span id="pwd_message" class="errorinfo Lcfl">&nbsp;</span>
						</div>
					</div>
					<div class="item Lovh">
						<div class="ltext Lfll">确认密码：</div>
						<div class="Lfll" style="width: 580px;">
							<div class="inputlbd Lfll">&nbsp;</div>
							<input id="rpassword" name="repwdString" class="input1 Lfll"
								value="" type="password" /> <span class="tips1">请再次输入登录密码。</span>
							<span id="rpwd_message" class="errorinfo Lcfl"></span>
						</div>
					</div>
					<div class="item Lovh">
						<div class="ltext Lfll">邮箱：</div>
						<div class="Lfll" style="width: 580px;">
							<div class="inputlbd Lfll">&nbsp;</div>
							<input id="email" type="text" class="input1 Lfll" name="email"
								value="" /> <span class="tips1">请输入您的邮箱。</span> <span
								id="email_message" class="errorinfo Lcfl"></span>
						</div>
					</div>

					<div class="item Lovh">
						<div class="ltext Lfll">验证码：</div>
						<div class="Lfll" style="width: 580px;">
							<div class="inputlbd Lfll">&nbsp;</div>
							<input type="text" maxlength="4" name="codeNumber"
								class="input2 Lfll" id="img1Code"> <span id="mySpan">
								<img align="middle"  class="code"
								src="<?php echo U('Index/code');?>" style='width:100px;height:28px'/>
							</span> <br /> <span id="img1_message" class="errorinfo Lcfl"><font
								color='red'></font> </span>
						</div>
					</div>

					<div class="item Lovh Lmt15">
						<div class="ltext Lfll">&nbsp;</div>
						<a class="btn btn_acceptAndRegister Lfll"><span>同意以下协议并注册</span>
						</a>
					</div>
					<div class="item">

						<div class="ltext Lfll">&nbsp;</div>

						<div class="Lfll">

							<a href=""
								target="_blank" class="useragreement">《邦购用户协议》</a>

						</div>

					</div>

				</form>
			</div>
			<!--普通注册步骤一结束-->


			<!--手机注册步骤一开始-->
			<div class="RG_sbox1 Lfll Lpt20 Lovh" id="mobile_div"
				style="display: none">
				<div class="RG_title">第一步：填写手机账户信息（以下内容均为必填）</div>
				<form name="mobile_form" id="mobile_form" method="post" action="">

					<div class="item Lovh Lmt15">
						<div class="ltext Lfll">用户名：</div>
						<div class="Lfll">

							<div class="inputlbd Lfll">&nbsp;</div>

							<input id="mobileusername" name="uid" value=""
								class="input1 Lfll" /> <span class="tips">4-20个字符，一个汉字为两个字符，推荐使用中文会会员名字。一旦注册成功会员名将不能修改。</span>
							<span id="mobile_user_message" class="errorinfo Lcfl">&nbsp;</span>

						</div>

					</div>

					<div class="item Lovh">

						<div class="ltext Lfll">手机号码：</div>

						<div class="Lfll">

							<div class="inputlbd Lfll">&nbsp;</div>

							<input id="mobileNumber" name="mobile" value=""
								class="input1 Lfll" /> <span class="tips">请输入您的手机号码。</span> <span
								id="mobileNumber_message" class="errorinfo Lcfl">&nbsp;</span>

						</div>

					</div>

					<div class="item Lovh">

						<div class="ltext Lfll">验证码：</div>

						<div class="Lfll">

							<div class="inputlbd Lfll">&nbsp;</div>

							<input type="text" maxlength="4" name="codeNumber"
								class="input2 Lfll" id="img2Code"> <span id="mySpan2">
								<img align="middle" id="img2" class="change_img" src="" /> <a
								onclick="changeImg('img2')">换一张</a>
							</span> <br /> <span id="img2_message" class="errorinfo Lcfl"></span>
						</div>

					</div>


					<div class="item Lovh">
						<div class="ltext Lfll">&nbsp;</div>
						<a class="btn btn_sendmessage  Lfll Lmr20" id=""><span>发送激活码</span>
						</a>
					</div>
				</form>
			</div>

			<!--手机注册步骤一结束-->

			<!--手机注册步骤二开始-->
			<div class="RG_sbox1 Lfll Lpt20 Lovh" id="mobile2_div"
				style="display: none">
				<div class="RG_title">第二步：填写获得的激活码</div>
				<form name="mobile2_form" id="mobile2_form" method="post"
					action="/CASServer/custom/registry.do">

					<input type="hidden" name="service"
						value="http://act.banggo.com/User/casregister.shtml"> <input
						type="hidden" name="codeNumber" value=""> <input
						type="hidden" name="sourceCode" value=""> <input
						type="hidden" name="little" value="9c7f52215d2865430edda96a77bf9ae4">
					<div class="item Lovh Lmt15">
						<div class="ltext Lfll">用户名：</div>
						<div class="Lfll">
							<div class="inputlbd Lfll">&nbsp;</div>
							<input type="text" class="input1 Lfll" id="user_id" name="uid"
								value="" readOnly /> <span class="errorinfo Lcfl">&nbsp;</span>
						</div>
					</div>

					<div class="item Lovh">

						<div class="ltext Lfll">手机号码：</div>

						<div class="Lfll">

							<div class="inputlbd Lfll">&nbsp;</div>

							<input type="text" class="input1 Lfll" id="mobile2" name="mobile"
								value="" readonly /> <span class="tips Lfll Ldn">&nbsp;</span>

							<span class="errorinfo Lcfl">&nbsp;</span>

						</div>

					</div>

					<div class="item Lovh">

						<div class="ltext Lfll">登录密码：</div>

						<div class="Lfll">

							<div class="inputlbd Lfll">&nbsp;</div>

							<input type="password" class="input1 Lfll" name="pwd"
								value="" id="pwd_mobile2_form" /> <span
								class="tips">6-16个字符，请使用字母加数字或符号的组合密码。</span> <span
								id="message_mobile2_form" class="errorinfo Lcfl">&nbsp;</span>

						</div>

					</div>

					<div class="item Lovh">

						<div class="ltext Lfll">确认密码：</div>

						<div class="Lfll">

							<div class="inputlbd Lfll">&nbsp;</div>

							<input type="password" class="input1 Lfll" name="rpassword"
								id="rpwd_mobile2_form" value="" /> <span class="tips">请再次输入登录密码。</span>
							<span id="rmessage_mobile2_form" class="errorinfo Lcfl"></span>
						</div>

					</div>

					<div class="item Lovh">

						<div class="ltext Lfll">激活码：</div>

						<div class="Lfll">

							<div class="inputlbd Lfll">&nbsp;</div>

							<input type="text" class="input1 Lfll" name="mobile_code"
								id="activeCode" value="" /> <span class="tips1">请输入您的激活码。</span>
							<span id="activeCode_messsage" class="errorinfo Lcfl">&nbsp;</span>


						</div>

					</div>

					<div class="item Lovh Lmt15">

						<div class="ltext Lfll">&nbsp;</div>

						<a class="btn btn_acceptAndRegister Lfll"><span>同意以下协议并注册</span>
						</a>

						<div class="postphonecode">

							<span id="notRecieve">手机未收到验证码，</span> <a class="rsendCode">重新发送</a>&nbsp;&nbsp;
							<span id="firstClickMessage" class="errorinfo Lcfl"
								style="color: red"></span><span id="errorMessage"
								class="errorinfo Lcfl" style="color: red"></span>

						</div>

					</div>



					<div class="item">

						<div class="ltext Lfll">&nbsp;</div>

						<div class="Lfll">

							<a href=""
								target="_blank" class="useragreement">《邦购用户协议》</a>

						</div>

					</div>

				</form>

			</div>

			<!--手机注册步骤二结束-->
			<div class="RG_sbox1 Lfll Lpt20 Lovh" id="card_div"
				style="display: none">
				<div class="RG_title">第一步：填写MVP卡账户信息（以下内容均为必填）</div>
				<form name="card_form" id="card_form" method="post"
					action="/CASServer/custom/doCardActive.do">
					<div class="item Lovh Lmt20">
						<input type="hidden" name="service" value="http://act.banggo.com/User/casregister.shtml">
						<div class="ltext Lfll">MVP卡号：</div>
						<div class="Lfll">
							<input type="hidden" name="service" value="http://act.banggo.com/User/casregister.shtml">
							<div class="inputlbd Lfll">&nbsp;</div>
							<input type="text" class="input1 Lfll" name="mvpCard.mvpNo"
								value="" id="mvpCard" /> <span
								class="tips1">请输入MVP卡卡号，卡号由13为数字组成。</span> <span
								id="card_message" class="errorinfo Lcfl"></span>
						</div>
					</div>
					<div class="item Lovh">
						<div class="ltext Lfll">mvp卡密码：</div>
						<div class="Lfll">
							<div class="inputlbd Lfll">&nbsp;</div>
							<input id="mvpPwd" name="mvpCard.mvpPwd" type="password"
								class="input1 Lfll" /> <span class="tips1">请输入MVP卡密码。</span> <span
								id="pwd_card_message" class="errorinfo Lcfl"></span>
						</div>
					</div>
					<div class="item Lovh">
						<div class="ltext Lfll">用户名：</div>
						<div class="Lfll">
							<div class="inputlbd Lfll">&nbsp;</div>
							<input id="uName" type="text" class="input1 Lfll" name="uid"
								value="" /> <span class="tips1">4-20个字符，一个汉字为两个字符，推荐使用中文会会员名字。一旦注册成功会员名将不能修改。</span>
							<span id="user_card_message" class="errorinfo Lcfl"></span>
						</div>
					</div>

					<div class="item Lovh">
						<div class="ltext Lfll">登录密码：</div>
						<div class="Lfll">
							<div class="inputlbd Lfll">&nbsp;</div>
							<input type="password" class="input1 Lfll" name="pwd"
								id="password_card_form" /> <span class="tips1">6-16个字符，请使用字母加数字或符号的组合密码。</span>
							<span id="password_card_message" class="errorinfo Lcfl"></span>
						</div>

					</div>
					<div class="item Lovh">
						<div class="ltext Lfll">确认密码：</div>
						<div class="Lfll">
							<div class="inputlbd Lfll">&nbsp;</div>
							<input type="password" class="input1 Lfll" name="newpwd"
								id="rpassword_card_form" /> <span class="tips1">请再次输入登录密码。</span>
							<span id="rpassword_card_message" class="errorinfo Lcfl"></span>
						</div>
					</div>
					<div class="item Lovh">
						<div class="ltext Lfll">邮箱：</div>
						<div class="Lfll">
							<div class="inputlbd Lfll">&nbsp;</div>
							<input type="text" class="input1 Lfll" name="email"
								id="email_card_form" value="" /> <span
								class="tips1">请输入您的邮箱。</span> <span id="email_card_message"
								class="errorinfo Lcfl"></span>
						</div>
					</div>

					<div class="item Lovh">
						<div class="ltext Lfll">验证码：</div>
						<div class="Lfll">
							<div class="inputlbd Lfll">&nbsp;</div>
							<input type="text" maxlength="4" name="codeNumber"
								class="input2 Lfll" id="img3Code"> <span id="mySpan3">
								<img align="middle" id="img3" class="change_img" src="" /> <a
								onclick="changeImg('img3')">换一张</a>
							</span> <br /> <span id="img3_message" class="errorinfo Lcfl"><font
								color='red'></font> </span>
						</div>
					</div>

					<div class="item Lovh Lmt15">
						<div class="ltext Lfll">&nbsp;</div>

						<a class="btn btn_acceptAndRegister Lfll"><span>同意以下协议并注册</span>
						</a>
					</div>
					<div>
						<div class="item">

							<div class="ltext Lfll">&nbsp;</div>

							<div class="Lfll">

								<a href=""
									target="_blank" class="useragreement">《邦购用户协议》</a>

							</div>

						</div>
				</form>
			</div>
			<!--消费卡注册步骤一结束-->
		</div>
		<!--注册页面公用，右侧内容开始-->
		<div class="rarea Lfll">
			<!-- <div class="RG_rightinfo Lovh Lti1000r"> -->
			<!-- 	<h3>邦购网欢迎您</h3>
				<p>
					欢迎注册成为邦购网会员，在这里您可以享受最贴心快捷的购物服务，我们的宗旨是让每一位顾客都得到最大满意~~~美特斯邦威，不走寻常路!^_^
				</p> -->
				<img src="http://localhost/banggou/Template/default/img/reg-banner.png" alt="">
			<!-- </div> -->
		</div>
		<!--注册页面公用，右侧内容结束-->

		<!--注册页面结束-->

		<script type="text/javascript">

	(function(){
		//注册方式tab切换
		$("#changetab a").each(function(i){
			$(this).click(function(){
			
			changeImg('img'+(i+1));
			
			$(this).siblings().removeClass();
			$(this).addClass('cstyle');
			var id = $(this).attr('id');
			var current_div = $("#"+id+"_div");
			$(current_div).siblings(".RG_sbox1,.RG_sbox2").hide();
			$(current_div).fadeIn(300);
			$("#submitType").val(i);
		   });
		});

	})();
  </script>
	</div>
	


<div class="LI_bottom">
	美特斯邦威集团网站：
	<a href="/">美特斯邦威</a> |
	<a href="/">ME&CITY</a> |
	<a href="/">CH'IN祺</a> |
	<a href="/">时尚秘书</a> |
	<a href="">邦购网</a>
</div>
</body>
<script type="text/javascript">
		var validUserName = false;
		var validpwd = false;
		var validrpwd=false;
		var validEmail = false;
		var isValid = false;
	   //通用的用户名验证方法
	  var userNameCheck = function(obj){
	          var inputID = obj.data.inputID;
	          var mvpID = obj.data.mvpID;
	          var messageID = obj.data.messageID;
	          var vkey=$('#vKey').val();
       	  	  var vValue=$('#vValue').val();
	          var myreg=/^[a-zA-Z|\u4e00-\u9fa5]+[\u4e00-\u9fa5\w\d]+$/
              if($('#'+inputID).val() == "" || $('#'+inputID).val().length == 0){
                      showMessage(messageID,"用户名不能为空",'red');
                      validUserName = false; 
                      return false;
               }
               if(lenReg($('#'+inputID).val()) < 4 || lenReg($('#'+inputID).val()) > 20){
                      showMessage(messageID,"用户名只能为4~20个字符,一个汉字为两个字符",'red');
                      
                      validUserName = false;
                      return false;
               }
               
               if(mvpID) {
	               if($('#'+inputID).val() == $('#'+mvpID).val()) {
	               		validUserName = true;
	               		showMessage(messageID,"","green");
		          		return true;
		           }
	           }
	           
               if(!myreg.test($('#'+inputID).val())){
                     showMessage(messageID,"以中、英文开头，与数字、下划线组成",'red');
                      validUserName = false;
                      return false;
               }
  			$.ajax({
				   type: "POST",
				   url: "/CASServer/custom/checkUidUniqueAjax.do",
				   data: "uid="+$('#'+inputID).val()+"&"+vkey+"="+vValue,
				   success: function(msg){
				    var obj = eval("("+msg+")");
				    if(obj.isOk == 1){
				    	showMessage(messageID,obj.message,'red');
				       validUserName = false;
				     }else if (obj.isOk == 2){
				       showMessage(messageID,obj.message,'red');
				       validUserName = false;
				    }else{
				    	showMessage(messageID,"用户名可用","green");
				    	validUserName = true;
				    }
				    $('#vKey').attr("value",obj.CASCheckKey);
			    	$('#vValue').attr("value",obj.CASCheckVale);
				  }   
			 });
			 
			 isValid = true;
       }
       
       
       
       //new一个普通用户并绑定普通用户用户名验证方法
       var userObj = new Object();
       userObj.inputID = 'username';
       userObj.messageID = 'user_message';
       $("#username").bind("blur",userObj,userNameCheck );
       
       //new一个手机用户并绑定手机用户用户名的验证方法
       var mobileUserObj = new Object();
       mobileUserObj.inputID = 'mobileusername';
       mobileUserObj.messageID = 'mobile_user_message';
       $("#mobileusername").bind("blur",mobileUserObj,userNameCheck );
       
       //new一个mvp卡用户并绑定消费卡用户用户名的验证方法
       var userCarObj = new Object();
       userCarObj.inputID = 'uName';
       userCarObj.messageID = 'user_card_message';
       userCarObj.mvpID = 'mvpCard';
       $("#uName").bind("blur",userCarObj,userNameCheck );
       
       
      //通用的密码验证
        var pwdCheck = function(obj){
	          var inputID = obj.data.inputID;
	          var messageID = obj.data.messageID;
	          
	         var lrtrim=/^\s+|\s+$/g;
	          if(lrtrim.test($('#'+inputID).val())){
	   			showMessage(messageID,"密码前后不能有空格",'red');
	   			 validpwd = false;
                  return false;
			  }
	          
	 
	 
              if($('#'+inputID).val() == "" || $('#'+inputID).val().length == 0){
                      showMessage(messageID,"密码不能为空",'red');
                      validpwd = false;
                      return false;
               }else if($('#'+inputID).val().length < 6 || $('#'+inputID).val().length > 16){
	                 showMessage(messageID,"密码长度只能为6~16",'red');
	                 validpwd = false;
	                 return false;
               }else if($('#r'+inputID).val() != "" && $('#r'+inputID).val().length != 0 
                         && $('#'+inputID).val() != $('#r'+inputID).val()){
                          showMessage(messageID,"",'green'); 
                          showMessage("r"+messageID,"两次密码不相同",'red'); 
                          validrpwd = false;
                          validpwd = true; 
                           return false;
               }else if($('#r'+inputID).val() != "" && $('#r'+inputID).val().length != 0 
                         && $('#'+inputID).val() == $('#r'+inputID).val()){
                           showMessage(messageID,"",'green'); 
                           showMessage("r"+messageID,"",'green');
                           validrpwd = true; 
                           validpwd = true;
                           return false;
                       }
            
              validpwd = true;
              showMessage(messageID,"",'green');
              return true;
       }
       
        //new一个普通用户并绑定普通用户密码的验证方法  
      var userpwdObj = new Object();
          userpwdObj.inputID = 'password';
          userpwdObj.messageID = 'pwd_message';
       $("#password").bind("blur",userpwdObj,pwdCheck );
       
        //new一个手机用户并绑定手机用户密码的验证方法
      var mobile_userpwdObj = new Object();
          mobile_userpwdObj.inputID = 'pwd_mobile2_form';
          mobile_userpwdObj.messageID = 'message_mobile2_form';
       $("#pwd_mobile2_form").bind("blur",mobile_userpwdObj,pwdCheck ); 
       
         //new一个mvp卡用户并绑定消费卡用户密码的验证方法
       var userCarPwdObj = new Object();
       userCarPwdObj.inputID = 'password_card_form';
       userCarPwdObj.messageID = 'password_card_message';
       $("#password_card_form").bind("blur",userCarPwdObj,pwdCheck );
       
       
      //普通用户确认密码的验证 
        
        $("#rpassword").blur( function(){
             if($('#rpassword').val()!=$('#password').val()){
                 showMessage("rpwd_message","两次密码不相同",'red');
                 validrpwd = false;
                 return false;   
              }
              
              validrpwd = true;
              showMessage("rpwd_message","",'green');
              return true; 
          }); 
        
       //手机用户确认密码的验证
        $("#rpwd_mobile2_form").blur(function(){
              if($('#rpwd_mobile2_form').val()!=$('#pwd_mobile2_form').val()){
                 showMessage("rmessage_mobile2_form","两次密码不相同",'red');
                 validrpwd = false;
                 return false;   
              }
              else {
              	showMessage("rmessage_mobile2_form","",'green');
              	validrpwd = true;
              	return true; 
               }
              }); 
              
         //消费卡用户确认密码的验证
       $("#rpassword_card_form").blur(function(){
              if($('#rpassword_card_form').val()!=$('#password_card_form').val()){
                 showMessage("rpassword_card_message","两次密码不相同",'red');
                 validrpwd = false;
                 return false;   
              }
              else {
              	showMessage("rpassword_card_message","",'green');
              	validrpwd = true;
              	return true; 
               }
              });
        
        //mvp卡密码的验证
        var validCarPwd = false;
        
        $("#mvpPwd").blur(function(){
           if(($('#mvpPwd').val() == "" || $('#mvpPwd').val().length == 0) && validmvpCard) {
           
              showMessage("pwd_card_message","请输入你的mvp卡密码！",'red');
              validCarPwd = false;
              return false;
           }else if(validmvpCard){
             $.ajax({
				   type: "POST",
				   url: "/CASServer/custom/checkMvpPwdAjax.do",
				    data: {mvpNo : $('#mvpCard').val(),mvpPwd : $('#mvpPwd').val()},
				   success: function(msg){
				    var obj = eval("("+msg+")");
				    if(obj.isOk == false){
				    	showMessage("pwd_card_message",obj.message,'red');
				    	validCarPwd = false;
				       return false;
				    }else{
				    	showMessage("pwd_card_message","","green");
				    	validCarPwd = true;
				    	return true;
				    }
				  }   
			 });  
			 }
        });
     
         //普通用户邮箱的验证
         var emailFun = function(){
        	   var vkey=$('#vKey').val();
        	   var vValue=$('#vValue').val();
               if($('#email').val().length==0||$('#email').val()==""){
                  showMessage("email_message","邮箱不能为空",'red');
                  validEmail = false;
                  return false; 
               }
               if(!/^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/.test($('#email').val())){
                 showMessage("email_message","邮箱格式不正确",'red');
                    validEmail = false;
                 	return false; 
              }
              $.ajax({
				   type: "POST",
				   url: "/CASServer/custom/checkEmailUniqueAjax.do",
				   data: "email="+$('#email').val()+"&"+vkey+"="+vValue,
				   success: function(msg){
				    var obj = eval("("+msg+")");
				    if(obj.isOk == false){
				    	showMessage("email_message",obj.message,'red');
				    	validEmail = false;
				       return false;
				    }else{
				    	showMessage("email_message","","green");
				    	validEmail = true;
				    	$('#vKey').attr("value",obj.CASCheckKey);
				    	$('#vValue').attr("value",obj.CASCheckVale);
				    	return true;
				    }
				  }   
			 });  
			 isValid = true;
         } 
        $("#email").bind("blur",emailFun);
         
       //消费卡用户邮箱的验证
	    $("#email_card_form").blur(function(){
	    	var vkey=$('#vKey').val();
     	  	  var vValue=$('#vValue').val();
               if($('#email_card_form').val().length==0||$('#email_card_form').val()==""){
                  showMessage("email_card_message","邮箱不能为空",'red');
                  validEmail = false;
                  return false; 
               }
               if(!/^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/.test($('#email_card_form').val())){
                 showMessage("email_card_message","邮箱格式不正确",'red');
                 validEmail = false;
                 	return false; 
              }
              $.ajax({
				   type: "POST",
				   url: "/CASServer/custom/checkEmailUniqueAjax.do",
				   data: "email="+$('#email_card_form').val()+"&"+vkey+"="+vValue,
				   success: function(msg){
				    var obj = eval("("+msg+")");
				    if(obj.isOk == false){
				    	showMessage("email_card_message",obj.message,'red');
				       validEmail = false;
				       return false;
				    }else{
				    	showMessage("email_card_message","","green");
				    	validEmail = true;
				    	$('#vKey').attr("value",obj.CASCheckKey);
				    	$('#vValue').attr("value",obj.CASCheckVale);
				    	return true;
				    }
				  }   
			 }); 
              
         });
	    
	   //手机号码验证
        var  mobileCheck = false;
        $("#mobileNumber").blur(function (){
        	var vkey=$('#vKey').val();
     	   var vValue=$('#vValue').val();
              if($('#mobileNumber').val()==""||$('#mobileNumber').val().length==0){
                showMessage("mobileNumber_message","手机号码不能为空",'red');
                mobileCheck = false;
                return false; 
              
              }
              if($('#mobileNumber').val().length!=11 || !/^1[3|4|5|8][0-9]+\d{4,8}$/.test($('#mobileNumber').val())){
                showMessage("mobileNumber_message","手机不合法！",'red');
                mobileCheck = false;
                return false;
              }
              
             $.ajax({
				   type: "POST",
				   url: "/CASServer/custom/checkMobileUniqueAjax.do",
				    data: "mobile="+$('#mobileNumber').val()+"&"+vkey+"="+vValue,
				   success: function(msg){
				   var obj = eval("("+msg+")");
				    if(obj.isOk == false){
				       showMessage("mobileNumber_message",obj.message,'red');
				       mobileCheck = false;
				       return false;
				    }else{
				    	showMessage("mobileNumber_message","","green");
				    	mobileCheck = true;
				    	$('#vKey').attr("value",obj.CASCheckKey);
				    	$('#vValue').attr("value",obj.CASCheckVale);
				         return true;
				    }
				  }   
			 });
        });
        
        
      //mvp卡号的验证
      var validmvpCard = false;
      $("#mvpCard").blur(function(){
         if($('#mvpCard').val() == "" || $('#mvpCard').val().length == 0){
             showMessage("card_message","请输入你的mvp卡号",'red');
             validmvpCard = false;
             return false;
         }else if($('#mvpCard').val().length!=13||!/^[0-9]*$/.test($('#mvpCard').val())){
             showMessage("card_message","卡号非法",'red');
             validmvpCard = false;
             return false;
         
         }else{
        	  $.ajax({
				   type: "POST",
				   url: "/CASServer/custom/validmvpCardAjax.do",
				    data: {mvpNo : $('#mvpCard').val()},
				   success: function(msg){
				   var obj = eval("("+msg+")");
				    if(obj.isOk == false){
				       showMessage("card_message",obj.message,'red');
				       validmvpCard = false;
				       return false;
				    }else{
				    	showMessage("card_message","","green");
				    	validmvpCard = true;
				         
				    }
				  }   
			 });
         }
         
      if($('#mvpPwd').val()!=""||$('#mvpPwd').val().length!=0){
         $.ajax({
				   type: "POST",
				   url: "/CASServer/custom/checkMvpPwdAjax.do",
				    data: {mvpNo : $('#mvpCard').val(),mvpPwd : $('#mvpPwd').val()},
				   success: function(msg){
				    var obj = eval("("+msg+")");
				    if(obj.isOk == false){
				    	showMessage("pwd_card_message",obj.message,'red');
				    	validCarPwd = false;
				        return false;
				    }else{
				    	showMessage("pwd_card_message","","green");
				    	validCarPwd = true;
				    	return true;
				    }
				  }   
			 });  
      }
      return true;
      
      });
      
      
      //激活码的验证
    var validactiveCode = false;
      $("#activeCode").blur( function() {
        $.ajax({
				   type: "POST",
				   url: "/CASServer/custom/valid_activeCodeAjax.do",
				    data: {activeCode : $('#activeCode').val()},
				   success: function(msg){
				   var obj = eval("("+msg+")");
				    if(obj.isOk == false){
				       showMessage("activeCode_messsage",obj.message,'red');
				       validactiveCode = false;
				       return false;
				    }else{
				    	showMessage("activeCode_messsage",obj.message,"green");
				    	validactiveCode = true;
				    	return true;
				    }
				  }   
			 });
			
        });
      
     
     
      //错误信息显示
       function showMessage(showTargetId,message,color){
            $("#"+showTargetId).html("<font color='"+color+"'>"+message+"</font>");
       	}
       	
       	
       //手机第一步的ajax请求
       $(".btn_sendmessage").click( function () {
           
           if(validUserName && mobileCheck && validCode){         
			       $.post("/CASServer/custom/create_activeCodeAjax.do", 
              		   {mobile : $('#mobileNumber').val(),mobileusername : $('#mobileusername').val()
              		   ,img:$('#img2Code').val()}, 
              		   function(msg) {
              		       var obj=eval("("+msg+")");
              		      if(obj.isOk==false){
              		          showMessage("img2_message",obj.message,"red");
              		          changeImg('img2');
              		          return false;
              		      }else{
              		    	var loadTime = new Date();
               				loadTime.setTime(loadTime.getTime() + 60*1000);
               				var couldFirstClick = loadTime.getTime();
               				document.cookie = "resendClickTime="+couldFirstClick+";expires="+loadTime.toGMTString();           		       
              		         $('#mobile_div').hide();
				             $('#mobile2_div').show();
				             $('#user_id').val($('#mobileusername').val());
				             $('#mobile2').val($('#mobileNumber').val());
				           }
                        }); 
                    return true;                   
			 }
		  else{
                alert("请正确填写表单！");
                return false;
              }
			  
			});  
			
       		var arrayObj = new Array();
   			var timerHandle;
			//重新发送激活码
			$(".rsendCode").click( function () {
				if($.cookie("resendClickTime")!=""&&$.cookie("resendClickTime")!=null&&$.cookie("resendClickTime")!='undefined'){
					var firstTime = new Date();
					var time = ($.cookie("resendClickTime")-firstTime.getTime())/1000;
					time = time+"";
					time = time.split(".")[0];
					$("#notRecieve").hide();
					$(".rsendCode").hide();
					$("#firstClickMessage").text("您的激活码已发送，请"+time+"秒后再试");
					timerHandle = setInterval("updatePromptMessage();",1000);
					arrayObj=arrayObj.concat(timerHandle);
					return;
				}
				if($.cookie("resendHasclick")==""||$.cookie("resendHasclick")==null){
					if(arrayObj.length>0){
						for(i=0;i<arrayObj.length;i++){
							clearInterval(arrayObj[i]);
						}
					}
					arrayObj.splice(0,arrayObj.length);
					clearInterval(timerHandle);
					var exp = new Date();
					exp.setTime(exp.getTime() + 60*1000);
					var leftTime = exp.getTime();
					document.cookie  = "resendHasclick = 1;expires="+exp.toGMTString();
					document.cookie  = "resendClickLeftTime="+leftTime+";expires="+exp.toGMTString();	
				}else{
					var now = new Date();
					var time = ($.cookie("resendClickLeftTime")-now.getTime()+10)/1000;
					time = time+"";
					time = time.split(".")[0];
					$("#notRecieve").hide();
					$(".rsendCode").hide();
					$("#errorMessage").text("您的操作过于频繁，请"+time+"秒后再试");
					showMessage("activeCode_messsage","","red");
					timerHandle = setInterval("updateWarnMessage();",1000);
					arrayObj=arrayObj.concat(timerHandle);
					//clearInterval(timerHandle);
					//setTimeout("enable();",20000);
					return;
				}
			  validactiveCode = false;
              if(validUserName && mobileCheck){
                 $.post("/CASServer/custom/create_activeCodeAjax.do", 
              		    {mobile : $('#mobile2').val(),mobileusername : $('#user_id').val(),img:$('#img2Code').val(),isReSend:'0'}, 
              		    function(msg) {
              		         var obj=eval("("+msg+")");
              		          if(obj.isOk==false){
              		          showMessage("activeCode_messsage",obj.message,"red");
              		        	setTimeout("enable();",20000);
              		        }else{
              		         showMessage("activeCode_messsage",obj.message,"green");
              		       		setTimeout("enable();",20000);
              		        }
				        
               });                      
                return true;
               }else{
                alert("请正确填写表单！");
                return false;
              }
			  
			});

			function enable(){
				var hasclick = $.cookie("resendHasclick");
				if(hasclick==""||hasclick==null){
					$("#errorMessage").text("");
					$("#notRecieve").show();
					$(".rsendCode").show();
				}
			}

			function updateWarnMessage(){
				var leftTimeWarn = $.cookie("resendClickLeftTime");
				if(leftTimeWarn!=null&&leftTimeWarn!=""&&leftTimeWarn!='undefined'){
					var now = new Date();
					var time = ($.cookie("resendClickLeftTime")-now.getTime())/1000;
					time = time+"";
					time = time.split(".")[0];
					$("#errorMessage").text("您的操作过于频繁，请"+time+"秒后再试");
				}else{
					$("#errorMessage").text("");
					$("#notRecieve").show();
					$(".rsendCode").show();
				}
			}

			function updatePromptMessage(){
				var leftTimePrompt = $.cookie("resendClickTime");
				if(leftTimePrompt!=null&&leftTimePrompt!=""&&leftTimePrompt!='undefined'){
					var firstTime = new Date();
					var time = ($.cookie("resendClickTime")-firstTime.getTime())/1000;
					time = time+"";
					time = time.split(".")[0];
					$("#firstClickMessage").text("您的激活码已发送，请"+time+"秒后再试");
				}else{
					$("#firstClickMessage").text("");
					$("#notRecieve").show();
					$(".rsendCode").show();
				}
			}
			
			
        //验证码为空的验证
        var validCode=false;
         $("#img1Code").blur(function (){
               if($('#img1Code').val()==""||$('#img1Code').val().length==0){
                      showMessage("img1_message","验证码不能为空",'red');
                      changeImg('img1');
                      validCode = false;
                      return false;
                 }
              else {
              validCode=true;
               showMessage("img1_message","",'green');
              }
         })
       $("#img2Code").blur(function(){
             if($('#img2Code').val()==""||$('#img2Code').val().length==0){
                      showMessage("img2_message","验证码不能为空",'red');
                      changeImg('img2');
                      validCode = false;
                      return false;
                 }
             else {
              validCode=true;
               showMessage("img2_message","",'green');
              }
       });
        $("#img3Code").blur(function(){
             if($('#img3Code').val()==""||$('#img3Code').val().length==0){
                      showMessage("img3_message","验证码不能为空",'red');
                      changeImg('img3');
                      validCode = false;
                      return false;
                 }
             else {
              validCode=true;
               showMessage("img3_message","",'green');
              }
       });
       var ischecked = false;
        //注册同步提交  
        $(".btn_acceptAndRegister").each(function(){
        	
	       $(this).click(function(){
	       if( ischecked ){
	      	 validmvpCard = true;
	       }
	       	var subType = $("#submitType").val();
	       //提交mvp卡表单
	        if(subType == 2 && validpwd && validrpwd && validUserName && validEmail && validmvpCard && validCode && validCarPwd){
	                 $("#card_form").submit();
	            //提交手机用户表单
	           }else if(subType == 1 && validactiveCode && validpwd && validrpwd ){
			        $("#mobile2_form").submit();
			     //提交普通用户表单
			   }else if(subType == 0 && validUserName && validpwd && validrpwd && validEmail && validCode ){
			        $("#normal_form").submit();
			  }else{
			         alert("请正确填写表单！");
			       	 return false;
			      }
	      });
      });
//更换验证码						
 function changeImg(imgId) {
       var imgSrc = $("#"+imgId);
       var src = "ImageServlet";
      imgSrc.attr("src", chgUrl(src));

  }
      //时间戳
     //为了使每次生成图片不一致，即不让浏览器读缓存，所以需要加上时间戳
   function chgUrl(url) {
         var timestamp = (new Date()).valueOf();
         var newUrl = url+"?time="+timestamp;
         return newUrl;
      }
 
	//正则表达式得出字符串的字节数	
    var lenReg = function(str){ 
     return str.replace(/[^\x00-\xFF]/g,'**').length; 
    }; 
    
	</script>
</html>
		 
	</head>
	<body></body>
</html>